#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>
#include <cctype>
using namespace std;

class Solution {
public:
	static bool isPalindrome(const string& s) {
		string s_lower;
		s_lower.resize(s.size());
		int i = 0, j = 0;
		while (i < s.size())
		{
			if (isalpha(s[i]) || isdigit(s[i]))
			{
				s_lower[j] = (char)tolower(s[i]);
				++j;
			}
			++i;
		}

		int left = 0, right = j - 1;
		while (left < right)
		{
			if (s_lower[left++] != s_lower[right--])
				return false;
		}
		return true;
	}
};

int main()
{
	cout << Solution::isPalindrome("0P");


	return 0;
}